home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_perl.idb / usr / freeware / catman / p_man / cat3 / Time::gmtime.Z / Time::gmtime
Encoding:
Text File  |  1998-10-28  |  2.9 KB  |  133 lines

  1.  
  2.  
  3.  
  4.      TTTTiiiimmmmeeee::::::::ggggmmmmttttiiiimmmmeeee((((3333)))) 22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))  TTTTiiiimmmmeeee::::::::ggggmmmmttttiiiimmmmeeee((((3333))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.       Time::gmtime - by-name interface to Perl's built-in _g_m_t_i_m_e()
  10.       function
  11.  
  12.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.        use Time::gmtime;
  14.        $gm = gmtime();
  15.        printf "The day in Greenwich    is %s\n",
  16.           (qw(Sun Mon Tue Wed Thu Fri Sat Sun))[ gm->wday()    ];
  17.  
  18.        use Time::gmtime w(:FIELDS;
  19.        printf "The day in Greenwich    is %s\n",
  20.           (qw(Sun Mon Tue Wed Thu Fri Sat Sun))[ gm_wday() ];
  21.  
  22.        $now    = gmctime();
  23.  
  24.        use Time::gmtime;
  25.        use File::stat;
  26.        $date_string    = gmctime(stat($file)->mtime);
  27.  
  28.  
  29.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  30.       This module's    default    exports    override the core _g_m_t_i_m_e()
  31.       function, replacing it with a    version    that returns
  32.       "Time::tm" objects.  This object has methods that return the
  33.       similarly named structure field name from the    C's tm
  34.       structure from _t_i_m_e._h; namely    sec, min, hour,    mday, mon,
  35.       year,    wday, yday, and    isdst.
  36.  
  37.       You may also import all the structure    fields directly    into
  38.       your namespace as regular variables using the    :FIELDS    import
  39.       tag.    (Note that this    still overrides    your core functions.)
  40.       Access these fields as variables named with a    preceding tm_
  41.       in front their method    names.    Thus, $tm_obj->mday()
  42.       corresponds to $tm_mday if you import    the fields.
  43.  
  44.       The _g_m_c_t_i_m_e()    funtion    provides a way of getting at the
  45.       scalar sense of the original _C_O_R_E::_g_m_t_i_m_e() function.
  46.  
  47.       To access this functionality without the core    overrides,
  48.       pass the use an empty    import list, and then access function
  49.       functions with their full qualified names.  On the other
  50.       hand,    the built-ins are still    available via the CORE::
  51.       pseudo-package.
  52.  
  53.      NNNNOOOOTTTTEEEE
  54.       While    this class is currently    implemented using the
  55.       Class::Struct    module to build    a struct-like class, you
  56.       shouldn't rely upon this.
  57.  
  58.      AAAAUUUUTTTTHHHHOOOORRRR
  59.       Tom Christiansen
  60.  
  61.  
  62.  
  63.      Page 1                        (printed 10/23/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      TTTTiiiimmmmeeee::::::::ggggmmmmttttiiiimmmmeeee((((3333)))) 22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))  TTTTiiiimmmmeeee::::::::ggggmmmmttttiiiimmmmeeee((((3333))))
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.      Page 2                        (printed 10/23/98)
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.